{smcl}
{* *! version 0.4 22-Apr-2020}{...}
{viewerjumpto "Title" "rdmcplot##title"}{...}
{viewerjumpto "Syntax" "rdmcplot##syntax"}{...}
{viewerjumpto "Description" "rdmcplot##description"}{...}
{viewerjumpto "Options" "rdmcplot##options"}{...}
{viewerjumpto "Examples" "rdmcplot##examples"}{...}
{viewerjumpto "Stored results" "rdmcplot##stored_results"}{...}
{viewerjumpto "References" "rdmcplot##references"}{...}
{viewerjumpto "Authors" "rdmcplot##authors"}{...}
{viewerjumpto "Also see" "rdmcplot##alsosee"}{...}
{cmd:help rdmcplot}{right: ({browse "https://doi.org/10.1177/1536867X20976320":SJ20-4: st0620})}
{hline}

{marker title}{...}
{title:Title}

{p2colset 5 17 19 2}{...}
{p2col:{cmd:rdmcplot} {hline 2}}RD plots for regression-discontinuity designs with multiple cutoffs{p_end}


{marker syntax}{...}
{title:Syntax}

{p 8 16 2}
{cmd:rdmcplot} {it:depvar} {it:runvar} {ifin}{cmd:,}
{cmd:{opt c:var}(}{it:cutoff_var}{cmd:)} 
[{cmdab:nbins:var(}{it:string}{cmd:)}
{cmd:{opt nbinsr:ightvar}(}{it:string}{cmd:)}
{cmd:{opt binselect:var}(}{it:string}{cmd:)} 
{cmd:{opt scale:var}(}{it:string}{cmd:)} 
{cmd:{opt scaler:ightvar}(}{it:string}{cmd:)} 
{cmd:{opt support:var}(}{it:string}{cmd:)} 
{cmd:{opt supportr:ightvar}(}{it:string}{cmd:)} 
{cmd:{opt p:var}(}{it:string}{cmd:)} 
{cmd:{opt h:var}(}{it:string}{cmd:)} 
{cmd:{opt hr:ightvar}(}{it:string}{cmd:)} 
{cmd:{opt kernel:var}(}{it:string}{cmd:)} 
{cmd:{opt weights:var}(}{it:string}{cmd:)} 
{cmd:{opt covs:var}(}{it:string}{cmd:)} 
{cmd:{opt covseval:var}(}{it:string}{cmd:)} 
{cmd:{opt covsdrop:var}(}{it:string}{cmd:)} 
{cmd:{opt binsopt:var}(}{it:string}{cmd:)} 
{cmd:{opt lineopt:var}(}{it:string}{cmd:)} 
{cmd:{opt xlineopt:var}(}{it:string}{cmd:)} 
{cmd:ci(}{it:cilevel}{cmd:)} 
{cmd:nobins} 
{cmd:nopoly}
{cmd:noxline}  
{cmd:nodraw}
{cmd:genvars}]{p_end}

{pstd}
{it:depvar} is the dependent variable.  {it:runvar} is the running variable
(also known as score or forcing variable).


{marker description}{...}
{title:Description}

{pstd}
{cmd:rdmcplot} plots estimated regression functions at each cutoff in
regression-discontinuity (RD) designs with multiple cutoffs.  For
methodological background, see Calonico, Cattaneo, and Titiunik (2015a), Keele
and Titiunik (2015), and Cattaneo et al. (2016, 2020).{p_end}

{pmore}
Companion commands are {helpb rdmc} for multicutoff RD estimation and
inference and {helpb rdms} for multiscore RD estimation and inference.{p_end}

{pmore}
A detailed introduction to this command is given in Cattaneo, Titiunik, and
Vazquez-Bare (2020).{p_end}

{pmore}
This command uses the Stata (and R) package {helpb rdrobust} for underlying
calculations.  See Calonico, Cattaneo, and Titiunik (2014, 2015b) and Calonico
et al. (2017) for more details.{p_end}

{pstd}
Related Stata and R packages useful for inference in RD designs are described
in the following website:{p_end}

{pmore}
{browse "https://rdpackages.github.io"}


{marker options}{...}
{title:Options}

{dlgtab:Estimand}

{phang}
{cmd:cvar(}{it:cutoff_var}{cmd:)} specifies the numeric variable
{it:cutoff_var}, which indicates the cutoff faced by each unit in the sample.
{cmd:cvar()} is required.

{dlgtab:Bin selection}

{phang}
{cmd:nbinsvar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the number of bins for
{cmd:rdplot}.  When {cmd:nbinsrightvar()} is specified, {cmd:nbinsvar()}
indicates the number of bins to the left of the cutoff.  When
{cmd:nbinsrightvar()} is not specified, the same number of bins is used at
each side.  See {helpb rdplot} for details.{p_end}

{phang}
{cmd:nbinsrightvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies the number of bins to the right
of the cutoff for {cmd:rdplot}.  When {cmd:nbinsrightvar()} is not specified,
the same number of bins in {cmd:nbinsvar()} is used at each side.  See
{helpb rdplot} for details.{p_end}

{phang}
{cmd:binselectvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies the bin selection method for
{cmd:rdplot}.  See {helpb rdplot} for details.{p_end}

{phang}
{cmd:scalevar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the scale for {cmd:rdplot}.  When
{cmd:scalerightvar()} is specified, {cmd:scalevar()} indicates the scale to
the left of the cutoff.  When {cmd:scalerightvar()} is not specified, the same
scale is used at each side.  See {helpb rdplot} for details.{p_end}

{phang}
{cmd:scalerightvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies the scale to the right of the
cutoff for {cmd:rdplot}.  When {cmd:scalerightvar()} is not specified, the
scale in {cmd:scalevar()} is used at each side.  See {helpb rdplot} for
details.{p_end}

{phang}
{cmd:supportvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies the support for {cmd:rdplot}.
When the option {cmd:supportrightvar()} is specified, {cmd:supportvar()}
indicates the support to the left of the cutoff.  When {cmd:supportrightvar()}
is not specified, the same support is used at each side.  See {helpb rdplot}
for details.{p_end}

{phang}
{cmd:supportrightvar(}{it:string}{cmd:)} specifies a variable of length equal
to the number of different cutoffs that specifies the support to the right of
the cutoff for {cmd:rdplot}.  When {cmd:supportrightvar()} is not specified,
the support in {cmd:supportvar()} is used at each side.  See {helpb rdplot}
for details.{p_end}

{dlgtab:Polynomial fit}

{phang}
{cmd:pvar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the order of the polynomials for
{cmd:rplot}.  See {helpb rdplot} for details.{p_end}

{phang}
{cmd:hvar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the bandwidths for {cmd:rdplot}.
When {cmd:hrightvar()} is specified, {cmd:hvar()} indicates the bandwidth to
the left of the cutoff.  When {cmd:hrightvar()} is not specified, the same
bandwidths is used at each side.  See {helpb rdplot} for details.{p_end}

{phang}
{cmd:hrightvar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the bandwidths to the right of the
cutoff for {cmd:rdplot}.  When {cmd:hrightvar()} is not specified, the
bandwidths in {cmd:hvar()} is used at each side.  See {helpb rdplot} for
details.{p_end}

{phang}
{cmd:kernelvar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the kernels for {cmd:rdplot}.  See
{helpb rdplot} for details.{p_end}

{phang}
{cmd:weightsvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies the weights for {cmd:rdplot}.
See {helpb rdplot} for details.{p_end}

{phang}
{cmd:covsvar(}{it:string}{cmd:)} specifies a variable of length equal to the
number of different cutoffs that specifies the covariates for {cmd:rdplot}.
See {helpb rdplot} for details.{p_end}

{phang}
{cmd:covsevalvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies the evaluation points for
additional covariates.  See {helpb rdplot} for details.{p_end}

{phang}
{cmd:covsdropvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies whether collinear covariates
should be dropped.  See {helpb rdplot} for details.{p_end}

{dlgtab:Plot}

{phang}
{cmd:binsoptvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies options for the bins
plots.{p_end}

{phang}
{cmd:lineoptvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies options for the polynomial
plots.{p_end}

{phang}
{cmd:xlineoptvar(}{it:string}{cmd:)} specifies a variable of length equal to
the number of different cutoffs that specifies options for the vertical lines
indicating the cutoffs.{p_end}

{phang}
{cmd:ci(}{it:cilevel}{cmd:)} adds confidence intervals of level {it:cilevel}
to the plot.{p_end}

{phang}
{cmd:nobins} omits the bins plot.{p_end}

{phang}
{cmd:nopoly} omits the polynomial curve plot.{p_end}

{phang}
{cmd:noxline} omits the vertical lines indicating the cutoffs.{p_end}

{phang}
{cmd:nodraw} omits the plot.{p_end}

{dlgtab:Generate variables}

{phang}
{cmd:genvars} generates variables to replicate plots by hand.  Variable labels
indicate the corresponding cutoff.{p_end}

{phang2}
{cmd:rdmcplot_hat_y_}{it:c} is the predicted value of the outcome variable
given by the global polynomial estimator in cutoff number {it:c}.{p_end}

{phang2}
{cmd:rdmcplot_mean_x_}{it:c} is the sample mean of the running variable
within the corresponding bin for each observation in cutoff number
{it:c}.{p_end}

{phang2}
{cmd:rdmcplot_mean_y_}{it:c} is the sample mean of the outcome variable
within the corresponding bin for each observation in cutoff number
{it:c}.{p_end}

{phang2}
{cmd:rdmcplot_ci_l_}{it:c} is the lower end value of the confidence interval
for the sample mean of the outcome variable within the corresponding bin for
each observation in cutoff number {it:c}.{p_end}

{phang2}
{cmd:rdmcplot_ci_r_}{it:c} is the upper end value of the confidence interval
for the sample mean of the outcome variable within the corresponding bin for
each observation in cutoff number {it:c}.{p_end}

		
{marker examples}{...}
{title:Examples}

{pstd}Standard use of {cmd:rdmcplot}{p_end}
{phang2}{cmd:. rdmcplot yvar xvar, cvar(cvar)}{p_end}

{pstd}{cmd:rdmcplot} without bins plot{p_end}
{phang2}{cmd:. rdmcplot yvar xvar, cvar(cvar) nobins}{p_end}


{marker stored_results}{...}
{title:Stored results}

{pstd}{cmd:rdmcplot} stores the following in {cmd:r()}:

{synoptset 20 tabbed}{...}
{p2col 5 20 24 2: Scalars}{p_end}
{synopt:{cmd:r(p)}}order of the polynomial{p_end}
{synopt:{cmd:r(cnum)}}number of cutoffs{p_end}

{p2col 5 20 24 2: Macros}{p_end}
{synopt:{cmd:r(cvar)}}cutoff variable{p_end}
{synopt:{cmd:r(clist)}}cutoff list{p_end}


{marker references}{...}
{title:References}

{phang}
Calonico, S., M. D. Cattaneo, M. H. Farrell, and R. Titiunik. 2017.
rdrobust: Software for regression-discontinuity designs.
{it:Stata Journal} 17: 372-404.
{browse "https://doi.org/10.1177/1536867X1701700208"}.

{phang}
Calonico, S., M. D. Cattaneo, and R. Titiunik. 2014.
Robust data-driven inference in the regression-discontinuity design.
{it:Stata Journal} 14: 909-946.
{browse "https://doi.org/10.1177/1536867X1401400413"}.

{phang}
------. 2015a. Optimal data-driven regression discontinuity plots.
{it:Journal of the American Statistical Association} 110: 1753-1769.
{browse "https://doi.org/10.1080/01621459.2015.1017578"}.

{phang}
------. 2015b.
rdrobust: An R package for robust nonparametric inference in
regression-discontinuity designs.
{it:R Journal} 7: 38-51.
{browse "https://doi.org/10.32614/RJ-2015-004"}.

{phang}
Cattaneo, M. D., L. Keele, R. Titiunik, and G. Vazquez-Bare. 2016.
Interpreting regression discontinuity designs with multiple cutoffs.
{it:Journal of Politics} 78: 1229-1248.
{browse "https://doi.org/10.1086/686802"}.

{phang}
------. 2020.
Extrapolating treatment effects in multi-cutoff regression discontinuity
designs.
{browse "https://cattaneo.princeton.edu/papers/Cattaneo-Keele-Titiunik-VazquezBare_2021_JASA.pdf"}.

{phang}
Cattaneo, M. D., R. Titiunik, and G. Vazquez-Bare. 2020.
Analysis of regression-discontinuity designs with multiple cutoffs or multiple
scores.
{it:Stata Journal} 20: 866-891.
{browse "https://doi.org/10.1177/1536867X20976320"}.

{phang}
Keele, L. J., and R. Titiunik. 2015.
Geographic boundaries as regression discontinuities.
{it:Political Analysis} 23: 127-155.
{browse "https://doi.org/10.1093/pan/mpu014"}.


{marker authors}{...}
{title:Authors}

{pstd}
Matias D. Cattaneo{break}
Princeton University{break}
Princeton, NJ{break}
{browse "mailto:cattaneo@princeton.edu":cattaneo@princeton.edu}{p_end}

{pstd}
Roc{c i'}o Titiunik{break}
Princeton University{break}
Princeton, NJ{break}
{browse "mailto:titiunik@princeton.edu":titiunik@princeton.edu}{p_end}

{pstd}
Gonzalo Vazquez-Bare{break}
University of California, Santa Barbara{break}
Santa Barbara, CA{break}
{browse "mailto:gvazquez@econ.ucsb.edu":gvazquez@econ.ucsb.edu}{p_end}


{marker alsosee}{...}
{title:Also see}

{p 4 14 2}
Article:  {it:Stata Journal}, volume 20, number 4: {browse "https://doi.org/10.1177/1536867X20976320":st0620}{p_end}
